﻿<!--
<copyright company="Christoph van der Fecht - VDsoft">
This code can be used in commercial, free and open source projects.
</copyright>
-->
<Window x:Class="VDsoft.SeriesNewsReader.Options"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Options" 
		Height="400" 
		Width="320"
        ResizeMode="NoResize"
		WindowStyle="ToolWindow"
        WindowStartupLocation="CenterScreen"
		DataContext="{Binding Path=OptionsView, Source={StaticResource Locator}}" Loaded="OnDialogLoad">
    <Window.Resources>
        <Style x:Key="FontAwesome" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="pack://application:,,,/Fonts/#FontAwesome"/>
            <Setter Property="Foreground" Value="#00325f"/>
        </Style>
    </Window.Resources>
    <Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="1.4*"/>
			<RowDefinition Height="1*"/>
			<RowDefinition Height="7*"/>
			<RowDefinition Height="1*"/>
		</Grid.RowDefinitions>
		<!--Add Series-->
		<StackPanel Grid.Row="0"
					Orientation="Vertical">
			<TextBlock Text="Add series"
					   Margin="5,2,0,0"/>
			<StackPanel Orientation="Horizontal">
			<TextBox Text="{Binding Path=ToAdd, Mode=TwoWay}"
					 MinWidth="220"
					 Margin="5,2,5,0"/>
                <Button Width="20"
						Height="20"
						Margin="5,2,5,0"
						Command="{Binding Path=AddNewSeriesCommand}"
						CommandParameter="{Binding Path=Text, ElementName=TextBoxToAdd}">
                    <Button.Content>
                        <TextBlock Text="&#xf067;"
                                   Style="{StaticResource ResourceKey=FontAwesome}"/>
                    </Button.Content>
                </Button>
			</StackPanel>
		</StackPanel>
		<TextBlock Text="Series:"
				   Margin="5,8,5,13"
				   Grid.Row="1"/>
        <Button Margin="45,5,170,10"
                Grid.Row="1"
                MaxWidth="200"
                MaxHeight="160"
                Command="{Binding Path=ImportSeriesComand}">
            <Button.Content>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="&#xf019;"
                               Margin="3"
                               FontSize="12"
                               Style="{StaticResource ResourceKey=FontAwesome}"/>
                    <TextBlock Text="Import..."
                               FontSize="12"
                               Margin="2,0,0,0"/>
                </StackPanel>
            </Button.Content>
        </Button>
		<!--Current series-->
		<ListView Grid.Row="2"
				  Margin="2"
				  ItemsSource="{Binding Path=Series, Mode=TwoWay}">
			<ListView.ItemTemplate>
				<DataTemplate>
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="20*"/>
							<ColumnDefinition Width="2*"/>
						</Grid.ColumnDefinitions>
						<TextBlock Text="{Binding}"
								   Margin="3"
								   MinWidth="220"
								   Grid.Column="0"/>
                        <Button Margin="3"
								Grid.Column="1"
								HorizontalAlignment="Right"
								Command="{Binding OptionsView.RemoveSeriesCommand, Source={StaticResource ResourceKey=Locator}}"
								CommandParameter="{Binding}">
                            <Button.Content>
                                <TextBlock Text="&#xf1f8;"
                                           FontSize="18"
                                           Style="{StaticResource ResourceKey=FontAwesome}"/>
                            </Button.Content>
                        </Button>
					</Grid>
				</DataTemplate>
			</ListView.ItemTemplate>
		</ListView>
		
		<StackPanel Grid.Row="3"
					Orientation="Horizontal"
					HorizontalAlignment="Center">
            <Button Margin="5"
					Height="20"
					Width="50"
					Click="OnButtonOKClick">
                <Button.Content>
                    <TextBlock Text="&#xf00c;"
                               FontSize="18"
                               Style="{StaticResource ResourceKey=FontAwesome}"/>
                </Button.Content>
            </Button>
            <Button Margin="5"
					Height="20"
					Width="50"
					Click="OnButtonCancleClick">
                <Button.Content>
                    <TextBlock Text="&#xf05e;"
                               FontSize="17"
                               Style="{StaticResource ResourceKey=FontAwesome}"/>
                </Button.Content>
            </Button>
		</StackPanel>
    </Grid>
</Window>
